package com.qqtech.qquan.user.service;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.qqtech.core.frame.model.Result;
import com.qqtech.core.frame.service.BaseService;
import com.qqtech.qquan.user.model.UserDraw;
import com.qqtech.qquan.user.model.UserDrawQuery;
import com.qqtech.qquan.user.model.UserDrawVo;

public interface UserDrawService extends BaseService<UserDraw> {
	/**
	 * 用户中奖的数据录入
	 * 
	 * @param userId
	 * @param drawItemId
	 */
	Result addUserDraw(Integer userId, Integer type, Integer bizzId, Integer drawBaseId);

	/**
	 * 后台查询列表--分页
	 * 
	 * @param query
	 * @param pageable
	 * @return
	 */
	public Page<UserDrawVo> queryPageListAdmin(UserDrawQuery query, Pageable pageable);

	/**
	 * 用户是否可以双旦抽奖
	 * 
	 * @param key
	 * @return
	 */
	public boolean isDraw(Integer userId);

	/**
	 * 用户是否可以双旦抽奖
	 * 
	 * @param key
	 * @return
	 */
	public boolean isDraw(Integer userId, String hours);

	/**
	 * 为抽奖页面查询对应的数据
	 * 
	 * @param userDrawQuery
	 * @param pageable
	 * @return
	 */
	public List<UserDrawVo> queryList4Draw(UserDrawQuery userDrawQuery, Pageable pageable);
}